package letsjava.pattern.chainofresponse;

public class ConcreteHandler2 implements Handler {
	private Handler successor;

	public ConcreteHandler2(Handler successor) {
		this.successor = successor;
	}

	public void handleRequest(Request request) {
		if (request instanceof PrintRequst) {
			System.out.println("request processed by ConcreteHandler2");
			request.execute();
		} else {
			// 传递到下一个
			System.out.println("request no handler");
			//successor.handleRequest(request);
		}
	}
}